﻿<script type="text/javascript" src="__PUBLIC__/admin/js/xc.js"></script> 
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.admin.js"></script>
<div class="cl pd-5 bg-1 bk-gray mb-10">
  <a class="btn btn-primary radius" onclick="layer_show('发送短信','__MODULE__/Message/send','500','400')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 发送短信</a>
  <a href="javascript:;" onclick="sms_look()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe725;</i> 标记为已读</a>
  <span class="r">共有数据：<strong>{$rows}</strong> 条</span>
</div>
<table id="xctable" class="table table-border table-bordered table-hover table-bg table-sort">
  <thead>
    <tr class="text-c">
      <th width="25"><input type="checkbox" name="" value=""></th>
      <th width="40" id="me_id" onClick="tab_sort(this)"><div class="">编号</div></th>
      <th width="40" id="me_type" onClick="tab_sort(this)"><div class="">类型</div></th>
      <th width="120" id="me_title" onClick="tab_sort(this)"><div class="">短信标题</div></th>
      <th width="250" id="me_body" onClick="tab_sort(this)"><div class="">短信内容</div></th>
      <th width="200" id="me_remark" onClick="tab_sort(this)"><div class="">管理员回复</div></th>
      <th width="70" id="me_fuid" onClick="tab_sort(this)"><div class="">发件人</div></th>
      <th width="120" id="me_atime" onClick="tab_sort(this)"><div class="">发送时间</div></th>
      <th width="40">操作</th>
    </tr>
  </thead>
  <volist name="list" id="vo" >
  <tr class="text-c">
    <td><if condition='($vo[me_slook] eq 0)'><input name="check" type="checkbox" value="{$vo.me_id}"></if></td>
    <td>{$i}</td>
    <td>{$mtype[$vo[me_type]]}</td>
    <td>{$vo.me_title}</td>
    <td class="text-l">{$vo.me_body}</td>
    <td class="text-l">{$vo.me_remark|default="<font color=#f00>暂未回复</font>"}</td>
    <td>{$vo.me_fuid}</td>
    <td>{$vo.me_atime|date='Y-m-d H:i',###}</td>
    <td>
      <a onclick="layer_show('短信回复','__MODULE__/Message/smsReply/id/{$vo.me_id}','650','400')" href="javascript:;"><i class="Hui-iconfont">&#xe603;</i></a>
      <a onClick="update_state('message','me_id={$vo.me_id}','me_sstate','2','删除');" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
    </td>
  </tr>
  </volist>
</table>
{$page}<!-- 分页-->
<script type="text/javascript">
$(".pagination a").click(function(){
	var page = $(this).data('p');
	ajax_get_table('myfrom1',page);
});
</script>
<script type="text/javascript">
/*删除*/
function sms_look(id){
	var page = $(this).data('p');
	var ck = $('input[name*=check]:checked');
	if(ck.length < 1){
		layer.msg('请选择项目', {icon: 2,time: 1000});
		return;
	}
	ck_ids = [];
	ck.each(function(){
		if($(this).is(':checked')){
			ck_ids.push($(this).val());
		}
	})
	$.ajax({
		type : 'post',
		url : '__MODULE__/Message/smsLook',
		data : {id:ck_ids},
		dataType : 'json',
		success : function(res){
			if(res.status == 1){
				layer.msg(res.msg, {icon: 1,time:3000},function(){
					ajax_get_table('myfrom1',page);	
				});
			}else{
				layer.msg(res.msg, {icon: 2});
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			layer.alert('网络失败，请刷新页面后重试',{icon:2});
		}
	})
}
</script>